doc: document stream.isDestroyed() - #64789
Open
YspritanHyzygy wants to merge 1 commit into
Open
Conversation
avivkeller
approved these changes
Jul 27, 2026
`stream.isDestroyed()` has been exported since v19.9.0 but was never documented, while its siblings `isErrored()`, `isReadable()` and `isWritable()` all have entries in `doc/api/stream.md`. Unlike those, `isDestroyed()` rejects Web streams: it returns `null` for anything that is not a Node.js stream. The accepted types are therefore documented as `Readable|Writable|Duplex` rather than also listing `ReadableStream`/`WritableStream`. Refs: nodejs#45671 Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Signed-off-by: YspritanHyzygy <yspritan@gmail.com>
YspritanHyzygy
force-pushed
the
doc-stream-isdestroyed
branch
from
July 27, 2026 18:28
6aca481 to
156cbce
Compare
Author
|
Corrected the Only the YAML block changed; the entry text is unchanged. |
lpinca
approved these changes
Jul 27, 2026
Author
|
|
bjohansebas
approved these changes
Jul 28, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
stream.isDestroyed()has been exported fromlib/stream.jssince v19.9.0 (#45671) but has never been documented, while the sibling helpers exported alongside it —isErrored(),isReadable()andisWritable()— all have entries.added:was determined by checkinglib/stream.jsat each release tag rather than from the landing date, since the commit predates the releases that carry it:Stream.isDestroyedpresentv20.0.0 inherited it from
mainrather than adding it, so it is not listed — matching howisErrored()lists only v17.3.0 and its v16.14.0 backport.One difference is worth calling out, because it affects the documented types: unlike
isErrored()andisReadable(),isDestroyed()bails out on anything that is not a Node.js stream (if (!isNodeStream(stream)) return null), so Web streams are not accepted:The entry therefore lists
Readable|Writable|Duplexand reuses the{boolean|null}wording already established byisReadable()andisWritable().make lint-mdandmake doc-onlyboth pass locally.